package cn.cheln.explorer.beans;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import cn.cheln.explorer.config.Config;
import cn.cheln.explorer.ds.sdcard.TypeFilter;
import cn.cheln.support.format.HourFormatter;
import com.direction.hold.FileApp;
import java.io.File;
import java.lang.reflect.Constructor;
import java.util.Date;

public class FileInfo
{
  public static final int AUDIO_ICON = 2130837534;
  public static final int DIR_RES = 2130837519;
  public static final int DOC_ICON = 2130837517;
  public static final int IMAGE_LOADING_ICON = 2130837538;
  public static final int OTHER_FILE_RES = 2130837539;
  public static final int PACKAGE_ICON = 2130837535;
  public static final int THEME_ICON = -2;
  public static final int VIDEO_ICON = 2130837537;
  public static TypeFilter fileFetcher;
  public static Bitmap iconAudio;
  public static Bitmap iconDir;
  public static Bitmap iconDoc;
  public static Bitmap iconImageLoading;
  public static Bitmap iconOtherFile;
  public static Bitmap iconPackage;
  public static Bitmap iconTheme;
  public static Bitmap iconVideo;
  public Boolean checkboxOption;
  private Context context;
  public Integer count;
  public String countStr;
  public long dbId;
  public Integer fileformat;
  private boolean forceDir;
  public Object iconRes;
  public Boolean isCutNew;
  public Boolean isDir;
  public boolean isFileBuilt;
  public boolean isIconBinded;
  public boolean isUISelected;
  public String lastModified;
  public Long lastModifiedInt;
  public Long leng;
  public String name;
  public Boolean overrideFlag;
  public String path;
  public String sizeText;
  public String sortKey;
  public String thumbnailPath;
  public String type;
  public Date unformattedDate;

  static
  {
    Integer[] arrayOfInteger = new Integer[2];
    arrayOfInteger[0] = Integer.valueOf(4);
    arrayOfInteger[1] = Integer.valueOf(Config.getHiddenOption(Config.SDCARD_HIDE_OPTION));
    fileFetcher = new TypeFilter(arrayOfInteger, null, null);
  }

  public FileInfo()
  {
    this.checkboxOption = Boolean.valueOf(false);
    this.iconRes = Integer.valueOf(-1);
  }

  public FileInfo(File paramFile, Context paramContext)
  {
    this.checkboxOption = Boolean.valueOf(false);
    this.iconRes = Integer.valueOf(-1);
    this.context = paramContext;
    buildFile(paramFile);
    this.isFileBuilt = true;
  }

  public FileInfo(File paramFile, Context paramContext, Boolean paramBoolean)
  {
    this(paramFile, paramContext);
    this.overrideFlag = paramBoolean;
  }

  public FileInfo(File paramFile, String paramString, Context paramContext)
  {
    this.checkboxOption = Boolean.valueOf(false);
    this.iconRes = Integer.valueOf(-1);
    this.path = paramFile.getAbsolutePath() + "/" + paramString;
    this.context = paramContext;
  }

  public FileInfo(String paramString)
  {
    this.checkboxOption = Boolean.valueOf(false);
    this.iconRes = Integer.valueOf(-1);
    this.path = paramString;
  }

  public FileInfo(String paramString, Context paramContext)
  {
    this(new File(paramString), paramContext);
  }

  public static FileInfo hasFileInfo(Class<? extends FileInfo> paramClass, File paramFile, Context paramContext)
  {
    return hasFileInfo(paramClass, paramFile, paramContext, null);
  }

  public static FileInfo hasFileInfo(Class<? extends FileInfo> paramClass, File paramFile, Context paramContext, Boolean paramBoolean)
  {
    if (paramBoolean == null);
    try
    {
      return ((FileInfo)paramClass.getConstructor(new Class[] { File.class, Context.class }).newInstance(new Object[] { paramFile, paramContext }));
      FileInfo localFileInfo = (FileInfo)paramClass.getConstructor(new Class[] { File.class, Context.class, Boolean.class }).newInstance(new Object[] { paramFile, paramContext, paramBoolean });
      return localFileInfo;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
    return null;
  }

  public static FileInfo hasFileInfoOnEntity(FileInfo paramFileInfo, File paramFile, Context paramContext)
  {
    if (!(paramFileInfo instanceof FileInfo))
      throw new IllegalStateException("wrong type info");
    return hasFileInfo(paramFileInfo.getClass(), paramFile, paramContext, null);
  }

  public static void init(Context paramContext)
  {
    if (iconDir == null)
      iconDir = ((BitmapDrawable)paramContext.getResources().getDrawable(2130837519)).getBitmap();
    if (iconOtherFile == null)
      iconOtherFile = ((BitmapDrawable)paramContext.getResources().getDrawable(2130837539)).getBitmap();
    if (iconDoc == null)
      iconDoc = ((BitmapDrawable)paramContext.getResources().getDrawable(2130837517)).getBitmap();
    if (iconImageLoading == null)
      iconImageLoading = ((BitmapDrawable)paramContext.getResources().getDrawable(2130837538)).getBitmap();
    if (iconVideo == null)
      iconVideo = ((BitmapDrawable)paramContext.getResources().getDrawable(2130837537)).getBitmap();
    if (iconAudio == null)
      iconAudio = ((BitmapDrawable)paramContext.getResources().getDrawable(2130837534)).getBitmap();
    if (iconPackage != null)
      return;
    iconPackage = ((BitmapDrawable)paramContext.getResources().getDrawable(2130837535)).getBitmap();
  }

  public void buildCountStr()
  {
    String str2;
    this.count = getCount();
    if (this.count.intValue() == -1)
    {
      str2 = "";
      label22: this.countStr = str2;
      return;
    }
    StringBuilder localStringBuilder = new StringBuilder("  ( ");
    if (this.count.intValue() == -2);
    for (String str1 = "..."; ; str1 = this.count)
    {
      str2 = str1 + " )";
      break label22:
    }
  }

  public void buildExtension()
  {
    if (this.type == null);
    for (String str = null; ; str = FileUtil.getRealExtension(getName()))
    {
      this.type = str;
      return;
    }
  }

  public void buildFile()
  {
    if (this.isFileBuilt)
      return;
    buildFile(new File(this.path));
    this.isFileBuilt = true;
  }

  public void buildFile(File paramFile)
    throws NumberFormatException
  {
    label17: Object localObject;
    boolean bool = true;
    if (!(paramFile.exists()))
    {
      this.isDir = Boolean.valueOf(bool);
      this.path = paramFile.getAbsolutePath();
      this.name = paramFile.getName();
      this.type = FileUtil.getRealExtension(this.name);
      this.leng = Long.valueOf(paramFile.length());
      this.sizeText = FileUtil.formatSize((float)this.leng.longValue());
      if (this.isDir.booleanValue())
        this.sizeText = "";
      this.lastModifiedInt = Long.valueOf(paramFile.lastModified());
      Date localDate = new Date(this.lastModifiedInt.longValue());
      if (this.context != null)
        break label196;
      localObject = FileApp.activity;
      label124: this.lastModified = HourFormatter.showFormattedDate(localDate, (Context)localObject);
      if (!(this.isDir.booleanValue()))
        break label205;
    }
    for (int i = -2; ; i = -1)
    {
      this.count = Integer.valueOf(i);
      this.iconRes = Integer.valueOf(-1);
      buildCountStr();
      return;
      if (this.forceDir);
      while (true)
      {
        this.isDir = Boolean.valueOf(bool);
        break label17:
        bool = paramFile.isDirectory();
      }
      label196: localObject = this.context;
      label205: break label124:
    }
  }

  public void buildName()
  {
    if (this.path == null);
    for (String str = null; ; str = FileUtil.getName(this.path))
    {
      this.name = str;
      return;
    }
  }

  public boolean equals(Object paramObject)
  {
    FileInfo localFileInfo;
    if (paramObject == null);
    do
    {
      return false;
      localFileInfo = (FileInfo)paramObject;
      if (getPath() != null)
        break;
    }
    while (localFileInfo.getPath() != null);
    do
      return true;
    while (getPath().equals(localFileInfo.getPath()));
    return false;
  }

  public Integer getCount()
  {
    return this.count;
  }

  public String getCountStr()
  {
    return this.countStr;
  }

  public File getFile()
  {
    if (getPath() == null)
      return null;
    return new File(getPath());
  }

  public Object getIconRes()
  {
    return this.iconRes;
  }

  public Boolean getIsDir()
  {
    return this.isDir;
  }

  public String getLastModified()
  {
    return this.lastModified;
  }

  public Long getLastModifiedInt()
  {
    return this.lastModifiedInt;
  }

  public Long getLeng()
  {
    return this.leng;
  }

  public String getName()
  {
    return this.name;
  }

  public String getPath()
  {
    return this.path;
  }

  public String getShowName()
  {
    return this.name;
  }

  public String getSizeText()
  {
    return this.sizeText;
  }

  public String getType()
  {
    return this.type;
  }

  public boolean isForceDir()
  {
    return this.forceDir;
  }

  public void setCount(Integer paramInteger)
  {
    this.count = paramInteger;
  }

  public void setCountStr(String paramString)
  {
    this.countStr = paramString;
  }

  public void setForceDir(boolean paramBoolean)
  {
    this.forceDir = paramBoolean;
  }

  public void setIconRes(Object paramObject)
  {
    this.iconRes = paramObject;
  }

  public void setIsDir(Boolean paramBoolean)
  {
    this.isDir = paramBoolean;
  }

  public void setLastModified(String paramString)
  {
    this.lastModified = paramString;
  }

  public void setLastModifiedInt(Long paramLong)
  {
    this.lastModifiedInt = paramLong;
  }

  public void setLeng(Long paramLong)
  {
    this.leng = paramLong;
  }

  public void setName(String paramString)
  {
    this.name = paramString;
  }

  public void setPath(String paramString)
  {
    this.path = paramString;
  }

  public void setSizeText(String paramString)
  {
    this.sizeText = paramString;
  }

  public void setType(String paramString)
  {
    this.type = paramString;
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     cn.cheln.explorer.beans.FileInfo
 * JD-Core Version:    0.5.2
 */